home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 4287 / 4287.xpi / chrome / splitbrowser.jar / content / splitbrowser / hacks.js < prev    next >
Text File  |  2009-11-05  |  22KB  |  634 lines

  1. SplitBrowser.hackForOtherExtensions = function() {
  2.  
  3.     var appcontent = document.getElementById('appcontent');
  4.  
  5.     // hack for Multiple Tab Handler
  6.     if ('MultipleTabService' in window &&
  7.         this.tabbedBrowsingEnabled) {
  8.         MultipleTabService.__defineGetter__('browser', function() {
  9.             return SplitBrowser.activeBrowser;
  10.         });
  11.         var initMTS = function(aEvent) {
  12.             MultipleTabService.initTabBrowser(aEvent.originalTarget.browser);
  13.         };
  14.         var destroyMTS = function(aEvent) {
  15.             MultipleTabService.destroyTabBrowser(aEvent.originalTarget.browser);
  16.         };
  17.         appcontent.addEventListener('SubBrowserAdded', initMTS, false);
  18.         appcontent.addEventListener('SubBrowserRemoveRequest', destroyMTS, false);
  19.         window.addEventListener('unload', function() {
  20.             appcontent.removeEventListener('SubBrowserAdded', initMTS, false);
  21.             appcontent.removeEventListener('SubBrowserRemoveRequest', destroyMTS, false);
  22.             window.removeEventListener('unload', arguments.callee, false);
  23.         }, false);
  24.     }
  25.  
  26.     // hack for Informational Tab
  27.     if ('InformationalTabService' in window &&
  28.         this.tabbedBrowsingEnabled) {
  29.         InformationalTabService.__defineGetter__('browser', function() {
  30.             return SplitBrowser.activeBrowser;
  31.         });
  32.         var initITS = function(aEvent) {
  33.             InformationalTabService.initTabBrowser(aEvent.originalTarget.browser);
  34.         };
  35.         var destroyITS = function(aEvent) {
  36.             InformationalTabService.destroyTabBrowser(aEvent.originalTarget.browser);
  37.         };
  38.         appcontent.addEventListener('SubBrowserAdded', initITS, false);
  39.         appcontent.addEventListener('SubBrowserRemoveRequest', destroyITS, false);
  40.         window.addEventListener('unload', function() {
  41.             appcontent.removeEventListener('SubBrowserAdded', initITS, false);
  42.             appcontent.removeEventListener('SubBrowserRemoveRequest', destroyITS, false);
  43.             window.removeEventListener('unload', arguments.callee, false);
  44.         }, false);
  45.     }
  46.  
  47.     // hack for ScrapBook
  48.     var scrapBookToolbox;
  49.     if (scrapBookToolbox = document.getElementById('ScrapBookToolbox')) {
  50.         this.moveAppContentContents(scrapBookToolbox, 1);
  51.     }
  52.  
  53.     // hack for FireBug
  54.     var fbSplitter;
  55.     if (fbSplitter = document.getElementById('fbContentSplitter')) {
  56.         this.moveAppContentContents(fbSplitter, 1);
  57.         this.moveAppContentContents(document.getElementById('fbContentBox'), 1);
  58. /*
  59.         var getTabBrowser = function() {
  60.             return window.__splitbrowser_firebug__lastBrowser || SplitBrowser.activeBrowser ;
  61.         };
  62.  
  63.         window.__defineGetter__('tabBrowser', getTabBrowser);
  64.         window.__defineSetter__('tabBrowser', getTabBrowser);
  65.         Firebug.__defineGetter__('tabBrowser', getTabBrowser);
  66.         Firebug.__defineSetter__('tabBrowser', getTabBrowser);
  67.  
  68.         eval('Firebug.toggleBar = '+Firebug.toggleBar.toSource().replace(
  69.             '{',
  70.             '{ if (contentBox.collapsed) { window.__splitbrowser_firebug__lastBrowser = SplitBrowser.activeBrowser; } '
  71.         ));
  72.         eval('Firebug.showBar = '+Firebug.showBar.toSource().replace(
  73.             '{',
  74.             '{ if (contentBox.collapsed) { window.__splitbrowser_firebug__lastBrowser = SplitBrowser.activeBrowser; } '
  75.         ));
  76.         var funcs = 'initialize,destroy,activate,deactivate,watchTopWindow,getBrowserByWindow'.split(',');
  77.         funcs.forEach(function(aFunc) {
  78.             eval('TabWatcher.'+aFunc+' = '+TabWatcher[aFunc].toSource().replace(
  79.                 /tabBrowser/g,
  80.                 'window.tabBrowser'
  81.             ));
  82.         });
  83.         window.__splitbrowser_firebug__fireBugToggle = function(aEvent) {
  84.             if (aEgent &&
  85.                 (aEvent.originalTarget || aEvent.target) != window.__splitbrowser_firebug__lastBrowser)
  86.                 return;
  87.             if (!contentBox.collapsed)
  88.                 Firebug.toggleBar();
  89.             window.__splitbrowser_firebug__lastBrowser = null;
  90.         };
  91.         document.documentElement.addEventListener('SubBrowserRemoveRequest', __splitbrowser_firebug__fireBugToggle, true);
  92.         window.addEventListener('unload', function() {
  93.             document.documentElement.removeEventListener('SubBrowserRemoveRequest', __splitbrowser_firebug__fireBugToggle, true);
  94.             window.removeEventListener('unload', arguments.callee, false);
  95.         }, false);
  96. */
  97.         FirebugChrome.initialize();
  98.     }
  99.  
  100.     // hack for MultiSidebar
  101.     var sidebarTop;
  102.     if (sidebarTop = document.getElementById('sidebar-3-box')) {
  103.         this.moveAppContentContents(document.getElementById('sidebar-3-splitter'), -1);
  104.         this.moveAppContentContents(sidebarTop, -1);
  105.         this.moveAppContentContents(document.getElementById('sidebar-4-splitter'), 1);
  106.         this.moveAppContentContents(document.getElementById('sidebar-4-box'), 1);
  107.     }
  108.  
  109.     // hack for Grab and Drag
  110.     if ('gadInit' in window) {
  111.         eval('window.gadInit = '+window.gadInit.toSource().replace(
  112.             /document\.getElementById\(['"]content['"]\)/g,
  113.             'SplitBrowser.activeBrowser'
  114.         ));
  115.         document.documentElement.addEventListener('SubBrowserFocusMoved', gadInit, false);
  116.         window.addEventListener('unload', function() {
  117.             document.documentElement.removeEventListener('SubBrowserFocusMoved', gadInit, false);
  118.             window.removeEventListener('unload', arguments.callee, false);
  119.         }, false);
  120.         gadInit();
  121.     }
  122.  
  123.     // hack for Google Notebook Extension
  124.     var gnotesBox;
  125.     if (gnotesBox = document.getElementById('gnotes-overlay')) {
  126.         var gnotesReattach = function(aEvent) {
  127.             if (window.getComputedStyle(gnotesBox, '').getPropertyValue('display') != 'block') return;
  128.  
  129.             var target = (aEvent.originalTarget || aEvent.target);
  130.  
  131.             var box  = gnotesBox.boxObject;
  132.             var bBox = target.boxObject;
  133.             var forceUpdate = false;
  134.  
  135.             if (aEvent.type == 'TabClose') {
  136.                 var b = target;
  137.                 while (b.localName != 'tabbrowser')
  138.                     b = b.parentNode;
  139.  
  140.                 var cIndex = -1,
  141.                     sIndex = -1,
  142.                     tabs = SplitBrowser.getTabsArray(b);
  143.                 for (var i = 0, maxi = tabs.length; i < maxi; i++)
  144.                 {
  145.                     if (tabs[i] == target)
  146.                         cIndex = i;
  147.                     else if (tabs[i] == b.selectedTab)
  148.                         sIndex = i;
  149.  
  150.                     if (cIndex > -1 && sIndex > -1)
  151.                         break;
  152.                 }
  153.  
  154.                 if (cIndex > sIndex) return;
  155.  
  156.                 bBox = target.linkedBrowser.boxObject;
  157.             }
  158.  
  159.             if (
  160.                 !forceUpdate &&
  161.                 (
  162.                 box.screenX + box.width < bBox.screenX ||
  163.                 box.screenX > bBox.screenX + bBox.width ||
  164.                 box.screenY + box.height < bBox.screenY ||
  165.                 box.screenY > bBox.screenY + bBox.height
  166.                 )
  167.                 )
  168.                 return;
  169.  
  170.             gnotesBox.style.display = 'none';
  171.             window.setTimeout(function() {
  172.                 gnotesBox.style.display = 'block';
  173.             }, 500);
  174.         };
  175.  
  176.         document.documentElement.addEventListener('SubBrowserAdded', gnotesReattach, false);
  177.         document.documentElement.addEventListener('SubBrowserTabSelect', gnotesReattach, false);
  178.         document.documentElement.addEventListener('TabClose', gnotesReattach, false);
  179.  
  180.         window.addEventListener('unload', function() {
  181.             document.documentElement.removeEventListener('SubBrowserAdded', gnotesReattach, false);
  182.             document.documentElement.removeEventListener('SubBrowserTabSelect', gnotesReattach, false);
  183.             document.documentElement.removeEventListener('TabClose', gnotesReattach, false);
  184.             delete gnotesBox;
  185.             window.removeEventListener('unload', arguments.callee, false);
  186.         }, false);
  187.     }
  188.  
  189.     // hack for Tab Clicking Options
  190.     if ('tabClicking' in window &&
  191.         this.tabbedBrowsingEnabled) {
  192.         var funcs = 'switchCase,onTabClick,onTabBarDblClick,duplicateInTab,closeAllTabs'.split(',');
  193.         funcs.forEach(function(aFunc) {
  194.             eval('tabClicking.'+aFunc+' = '+tabClicking[aFunc].toSource().replace(
  195.                 /gBrowser|getBrowser\(\)/g,
  196.                 'SplitBrowser.activeBrowser'
  197.             ).replace(
  198.                 /gURLBar.select()/g,
  199.                 'SplitBrowser.activeBrowserSelectURLBar()'
  200.             ));
  201.         });
  202.         tabClicking.__splitbrowser__selectURLBar = tabClicking.selectURLBar;
  203.         tabClicking.selectURLBar = function() {
  204.             if (SplitBrowser.activeBrowser &&
  205.                 SplitBrowser.activeBrowser.parentSubBrowser &&
  206.                 SplitBrowser.activeBrowser.parentSubBrowser.localName == 'subbrowser') {
  207.                 SplitBrowser.activeBrowserFocusURLBar();
  208.                 return;
  209.             }
  210.             return this.__splitbrowser__selectURLBar();
  211.         };
  212.         var initTCO = function(aEvent) {
  213.             var b = aEvent.originalTarget.browser;
  214.             b.onTabClick = tabClicking.onTabClick;
  215.             b.mTabContainer.setAttribute('ondblclick', 'tabClicking.onTabBarDblClick(event);');
  216.         };
  217.         appcontent.addEventListener('SubBrowserAdded', initTCO, false);
  218.         window.addEventListener('unload', function() {
  219.             appcontent.removeEventListener('SubBrowserAdded', initTCO, false);
  220.             window.removeEventListener('unload', arguments.callee, false);
  221.         }, false);
  222.     }
  223.  
  224.     // hack for All-in-One Gestures
  225.     if ('aioInit' in window) {
  226.         gBrowser.aioTabsNb = gBrowser.mPanelContainer.childNodes.length;
  227.  
  228.         try {
  229.             aioRendering.removeEventListener('contextmenu', aioContextMenuEnabler, true);
  230.             aioRendering.removeEventListener('mousedown', aioMouseDown, true);
  231.             gBrowser.mTabBox.removeEventListener('select', aioTabFocus, true);
  232.             gBrowser.mTabBox.removeEventListener('load', aioTabLoad, true);
  233.         }
  234.         catch(e) {
  235.         }
  236.  
  237.         if (this.tabbedBrowsingEnabled) {
  238.             window.__splitbrowser__aioInit = window.aioInit;
  239.             window.aioInit = function() {
  240.                 window.__splitbrowser__aioInit();
  241.                 SplitBrowser._browsers.forEach(
  242.                     aioTabSwitching ?
  243.                         function(aBrowser) {
  244.                             aBrowser.browser.mStrip.addEventListener('DOMMouseScroll', aioSwitchTabs, true);
  245.                         } :
  246.                         function(aBrowser) {
  247.                             aBrowser.browser.mStrip.removeEventListener('DOMMouseScroll', aioSwitchTabs, true);
  248.                         }
  249.                 );
  250.             };
  251.         }
  252.  
  253.         eval('window.aioTabFocus = '+window.aioTabFocus.toSource().replace(
  254.             /\{/,
  255.             '{'+
  256.                 'if (e.originalTarget.ownerDocument != document) return;'+
  257.                 'var b = e.originalTarget;'+
  258.                 'while (b.localName != "tabbrowser")'+
  259.                     'b = b.parentNode;'
  260.         ).replace(
  261.             /aioTabsNb/g,
  262.             'b.aioTabsNb'
  263.         ).replace(
  264.             /aioContent/g,
  265.             'b'
  266.         ).replace(
  267.             /aioRendering/g,
  268.             '(b.mPanelContainer || b)'
  269.         ));
  270.         eval('window.aioTabLoad = '+window.aioTabLoad.toSource().replace(
  271.             /\{/,
  272.             '{'+
  273.                 'if ((e.originalTarget.ownerDocument || e.originalTarget) == document) return;'+
  274.                 'var b, w = (e.originalTarget.ownerDocument || e.originalTarget).defaultView.top;'+
  275.                 'if (gBrowser.browsers.some(function(aBrowser) { return w == aBrowser.contentWindow; })) {'+
  276.                     'b = gBrowser;'+
  277.                 '}'+
  278.                 'else {'+
  279.                     'for (var i = 0, maxi = SplitBrowser.browsers.length; i < maxi; i++)'+
  280.                     '{'+
  281.                         'if ((b = SplitBrowser.browsers[i].browser).browsers.some(function(aBrowser) { return w == aBrowser.contentWindow; })) break;'+
  282.                     '}'+
  283.                 '}'
  284.         ).replace(
  285.             /aioTabsNb/g,
  286.             'b.aioTabsNb'
  287.         ).replace(
  288.             /aioRendering/g,
  289.             '(b.mPanelContainer || b)'
  290.         ));
  291.         var funcs = 'aioStartTrail,aioIsAreaOK,aioIsPastable,aioMouseDown,aioAddMarker,aioWheelScroll'.split(',');
  292.         funcs.forEach(function(aFunc) {
  293.             eval('window.'+aFunc+' = '+window[aFunc].toSource().replace(
  294.                 /e.target/g,
  295.                 'e.originalTarget'
  296.             ));
  297.         });
  298.         eval('window.aioOpenInNewTab = '+window.aioOpenInNewTab.toSource().replace(
  299.             /BrowserOpenTab\(\);/,
  300.             'SplitBrowser.activeBrowserOpenTab();'
  301.         ));
  302.         eval('window.aioCloseCurrTab = '+window.aioCloseCurrTab.toSource().replace(
  303.             /BrowserCloseWindow\(\);/,
  304.             'SplitBrowser.activeBrowserCloseWindow();'
  305.         ));
  306.         var initAIOG = function(aEvent) {
  307.             var b = aEvent.originalTarget.browser;
  308.             b.mTabBox.addEventListener('select', aioTabFocus, true);
  309.             b.mTabBox.addEventListener('load', aioTabLoad, true);
  310.             b.aioTabsNb = b.mPanelContainer.childNodes.length;
  311.         };
  312.         var destroyAIOG = function(aEvent) {
  313.             var b = aEvent.originalTarget.browser;
  314.             b.mTabBox.removeEventListener('select', aioTabFocus, true);
  315.             b.mTabBox.removeEventListener('load', aioTabLoad, true);
  316.         };
  317.         appcontent.addEventListener('SubBrowserAdded', initAIOG, false);
  318.         appcontent.addEventListener('SubBrowserRemoveRequest', destroyAIOG, false);
  319.         window.addEventListener('unload', function() {
  320.             appcontent.removeEventListener('SubBrowserAdded', initAIOG, false);
  321.             appcontent.removeEventListener('SubBrowserRemoveRequest', destroyAIOG, false);
  322.             window.removeEventListener('unload', arguments.callee, false);
  323.         }, false);
  324.  
  325.         eval('window.aioActionTable = '+window.aioActionTable.toSource().replace(
  326.             /addBookmarkAs\(aioContent\)/g,
  327.             'addBookmarkAs\(SplitBrowser.activeBrowser\)'
  328.         ).replace(
  329.             /BrowserReload\(\)/g,
  330.             'SplitBrowser.activeBrowserReload()'
  331.         ).replace(
  332.             /BrowserReloadSkipCache\(\)/g,
  333.             'SplitBrowser.activeBrowserReloadSkipCache()'
  334.         ).replace(
  335.             /BrowserOpenTab\(\)/g,
  336.             'SplitBrowser.activeBrowserOpenTab()'
  337.         ).replace(
  338.             /BrowserStop\(\)/g,
  339.             'SplitBrowser.activeBrowserStop()'
  340.         ).replace(
  341.             /BrowserBack\(([^\)]*)\)/g,
  342.             'SplitBrowser.activeBrowserBack($1)'
  343.         ).replace(
  344.             /BrowserForward\(([^\)]*)\)/g,
  345.             'SplitBrowser.activeBrowserForward($1)'
  346.         ).replace(
  347.             /BrowserPageInfo\(\)/g,
  348.             'SplitBrowser.activeBrowserViewPageInfo()'
  349.         ).replace(
  350.             /aioSrcEvent.target/g,
  351.             'aioSrcEvent.originalTarget'
  352.         ));
  353.     }
  354.  
  355.  
  356.     // hack for IE Tab
  357.     if ('IeTab' in window && false) {
  358.         eval('IeTab.prototype.hookCodeAll = '+IeTab.prototype.hookCodeAll.toSource().replace(
  359.             /(gIeTab.hookURLBarSetter|gIeTab.hookCode\("(nsBrowserAccess|handleURLBarRevert|BrowserLoadURL|getShortcutOrURI|BrowserBack|BrowserForward|BrowserStop|BrowserReload|BrowserReloadSkipCache|saveDocument|BrowserViewSourceOfDocument|MailIntegration|PrintUtils.print"|PrintUtils.showPageSetup|PrintUtils.printPreview|goDoCommand|cmd_find|cmd_findAgain|cmd_findPrevious|displaySecurityInfo))/,
  360.             'if (this.gBrowser == gBrowser) $1'
  361.         ));
  362.         eval('IeTab.prototype.addEventAll = '+IeTab.prototype.addEventAll.toSource().replace(
  363.             /window, "(DOMContentLoaded|pageshow)"/,
  364.             'this.gBrowser, "$1"'
  365.         ).replace(
  366.             /"appcontent"/,
  367.             'gBrowser.mTabContainer'
  368.         ).replace(
  369.             /(gIeTab.onTabSelected\);)/,
  370.             '$1 if (this.gBrowser != gBrowser) return;'
  371.         ));
  372.         eval('IeTab.prototype.removeEventAll = '+IeTab.prototype.removeEventAll.toSource().replace(
  373.             /window, "(DOMContentLoaded|pageshow)"/,
  374.             'this.gBrowser, "$1"'
  375.         ).replace(
  376.             /"appcontent"/,
  377.             'gBrowser.mTabContainer'
  378.         ).replace(
  379.             /(gIeTab.onTabSelected\);)/,
  380.             '$1 if (this.gBrowser != gBrowser) return;'
  381.         ));
  382.         for (var i in IeTab.prototype)
  383.         {
  384.             try {
  385.                 eval('IeTab.prototype.'+i+' = '+IeTab.prototype[i].toSource().replace(
  386.                     /gIeTab/g,
  387.                     'this'
  388.                 ).replace(
  389.                     /thisChromeStr/g,
  390.                     'gIeTabChromeStr'
  391.                 ));
  392.             }
  393.             catch(e) {
  394.                 dump('IeTab.prototype.'+i+' // '+e+'\n');
  395.             }
  396.         }
  397.         funcs = 'getIeTabElmt,getIeTabElmtURL,switchTabEngine,switchEngine,loadIeTab,addIeTab,getHandledURL,updateUrlBar,updateBackForwardButtons,updateStopReloadButtons,updateProgressStatus,onProgressChange,closeIeTab,getContextTab,viewPage,updateTabbarMenu,createTabbarMenu,hookCodeAll,addEventAll,removeEventAll'.split(',');
  398.         funcs.forEach(function(aFunc) {
  399.             try {
  400.                 eval('IeTab.prototype.'+aFunc+' = '+IeTab.prototype[aFunc].toSource().replace(
  401.                     /gBrowser/g,
  402.                     'this.gBrowser'
  403.                 ));
  404.             }
  405.             catch(e) {
  406.                 dump('IeTab.prototype.'+i+' // '+e+'\n');
  407.             }
  408.         });
  409.  
  410.  
  411.         IeTab.prototype.__defineGetter__('gBrowser', function() {
  412.             return this._gBrowser || SplitBrowser.activeBrowser;
  413.         });
  414.         IeTab.prototype._gBrowser = gBrowser;
  415.         var initIETab = function(aEvent) {
  416.             var b = aEvent.originalTarget.browser;
  417.             b.IeTab = new IeTab();
  418.             b.IeTab._gBrowser = b;
  419.             b.IeTab.init();
  420.         };
  421.         var destroyIETab = function(aEvent) {
  422.             aEvent.originalTarget.browser.IeTab.destroy();
  423.         };
  424.         appcontent.addEventListener('SubBrowserAdded', initIETab, false);
  425.         appcontent.addEventListener('SubBrowserRemoveRequest', destroyIETab, false);
  426.         window.addEventListener('unload', function() {
  427.             appcontent.removeEventListener('SubBrowserAdded', initIETab, false);
  428.             appcontent.removeEventListener('SubBrowserRemoveRequest', destroyIETab, false);
  429.             window.removeEventListener('unload', arguments.callee, false);
  430.         }, false);
  431.         
  432.     }
  433.  
  434.  
  435.     // ReloadEvery
  436.     if ('getCurTab' in window) {
  437.         eval('window.getCurTab = '+window.getCurTab.toSource().replace(
  438.             'getBrowser()',
  439.             'SplitBrowser.activeBrowser'
  440.         ));
  441.         var gatherAllBrowsers = <![CDATA[
  442.                 var browsers = Array.slice(gBrowser.browsers);
  443.                 SplitBrowser.browsers.forEach(function(aSubBrowser) {
  444.                     if (aSubBrowser.browser.localName == 'tabbrowser')
  445.                         browsers = browsers.concat(Array.slice(aSubBrowser.browser.browsers));
  446.                     else
  447.                         browsers.push(aSubBrowser.browser);
  448.                 });
  449.             ]]>.toString();
  450.         eval('window.onReloadEveryEnableAllTabs = '+window.onReloadEveryEnableAllTabs.toSource().replace(
  451.             /getBrowser\(\)\.browsers/g,
  452.             'browsers'
  453.         ).replace(
  454.             '{',
  455.             '{'+gatherAllBrowsers
  456.         ));
  457.         eval('window.onReloadEveryDisableAllTabs = '+window.onReloadEveryEnableAllTabs.toSource().replace(
  458.             /getBrowser\(\)\.browsers/g,
  459.             'browsers'
  460.         ).replace(
  461.             '{',
  462.             '{'+gatherAllBrowsers
  463.         ));
  464.     }
  465.  
  466.  
  467.     window.setTimeout('SplitBrowser.hackForOtherExtensionsWithDelay()', 0);
  468. };
  469.  
  470.  
  471.  
  472. SplitBrowser.hackForOtherExtensionsWithDelay = function() {
  473.  
  474.     var appcontent = document.getElementById('appcontent');
  475.  
  476.     // hack for All-in-One Gestures
  477.     if ('aioInit' in window) {
  478.         gBrowser.aioTabsNb = gBrowser.mPanelContainer.childNodes.length;
  479.  
  480.         try {
  481.             aioRendering.removeEventListener('contextmenu', aioContextMenuEnabler, true);
  482.             aioRendering.removeEventListener('mousedown', aioMouseDown, true);
  483.             gBrowser.mTabBox.removeEventListener('select', aioTabFocus, true);
  484.             gBrowser.mTabBox.removeEventListener('load', aioTabLoad, true);
  485.         }
  486.         catch(e) {
  487.         }
  488.  
  489.         appcontent.addEventListener('contextmenu', aioContextMenuEnabler, true);
  490.         appcontent.addEventListener('mousedown', aioMouseDown, true);
  491.         gBrowser.mTabBox.addEventListener('select', aioTabFocus, true);
  492.         gBrowser.mTabBox.addEventListener('load', aioTabLoad, true);
  493.  
  494.         window.aioContent = {
  495.             get mTabBox() {
  496.                 return SplitBrowser.activeBrowser.mTabBox;
  497.             },
  498.             get mTabContainer() {
  499.                 return SplitBrowser.activeBrowser.mTabContainer;
  500.             },
  501.             get mPanelContainer() {
  502.                 return SplitBrowser.activeBrowser.mPanelContainer;
  503.             },
  504.             get mStrip() {
  505.                 return SplitBrowser.activeBrowser.mStrip;
  506.             },
  507.             get ownerDocument() {
  508.                 return SplitBrowser.activeBrowser.ownerDocument;
  509.             },
  510.             get selectedBrowser() {
  511.                 return SplitBrowser.activeBrowser.selectedBrowser;
  512.             },
  513.             addEventListener : function()
  514.             {
  515.                 SplitBrowser.activeBrowser.addEventListener.apply(SplitBrowser.activeBrowser, arguments);
  516.             },
  517.             removeEventListener : function()
  518.             {
  519.                 SplitBrowser.activeBrowser.removeEventListener.apply(SplitBrowser.activeBrowser, arguments);
  520.             },
  521.             reloadAllTabs : function()
  522.             {
  523.                 return SplitBrowser.activeBrowser.reloadAllTabs.apply(SplitBrowser.activeBrowser, arguments);
  524.             },
  525.             removeAllTabsBut : function()
  526.             {
  527.                 return SplitBrowser.activeBrowser.removeAllTabsBut.apply(SplitBrowser.activeBrowser, arguments);
  528.             },
  529.             removeCurrentTab : function()
  530.             {
  531.                 return SplitBrowser.activeBrowser.removeCurrentTab.apply(SplitBrowser.activeBrowser, arguments);
  532.             },
  533.             warnAboutClosingTabs : function()
  534.             {
  535.                 return SplitBrowser.activeBrowser.warnAboutClosingTabs.apply(SplitBrowser.activeBrowser, arguments);
  536.             },
  537.             getBrowserForTab : function()
  538.             {
  539.                 return SplitBrowser.activeBrowser.getBrowserForTab.apply(SplitBrowser.activeBrowser, arguments);
  540.             },
  541.             get undoRemoveTab()
  542.             {
  543.                 return this.wrappedUndoRemoveTab;
  544.             },
  545.             wrappedUndoRemoveTab : function() {
  546.                 SplitBrowser.activeBrowser.undoRemoveTab.apply(SplitBrowser.activeBrowser, arguments);
  547.             },
  548.             get webNavigation()
  549.             {
  550.                 return SplitBrowser.activeBrowser.webNavigation;
  551.             },
  552.             get mTabContainer()
  553.             {
  554.                 return SplitBrowser.activeBrowser.mTabContainer;
  555.             },
  556.             get removeTab()
  557.             {
  558.                 return this.wrappedRemoveTab;
  559.             },
  560.             wrappedRemoveTab : function() {
  561.                 SplitBrowser.activeBrowser.removeTab.apply(SplitBrowser.activeBrowser, arguments);
  562.             },
  563.             set removeTab(val)
  564.             {
  565.                 return SplitBrowser.activeBrowser.removeTab = val;
  566.             },
  567.             get selectedTab()
  568.             {
  569.                 return SplitBrowser.activeBrowser.selectedTab;
  570.             },
  571.             set selectedTab(val)
  572.             {
  573.                 return SplitBrowser.activeBrowser.selectedTab = val;
  574.             },
  575.             get mCurrentTab() {
  576.                 return SplitBrowser.activeBrowser.mCurrentTab;
  577.             },
  578.             get aioNativeRemoveTab()
  579.             {
  580.                 return this.wrappedNativeRemoveTab ;
  581.             },
  582.             wrappedNativeRemoveTab : function() {
  583.                 SplitBrowser.activeBrowser.aioNativeRemoveTab.apply(SplitBrowser.activeBrowser, arguments);
  584.             },
  585.             set aioNativeRemoveTab(val)
  586.             {
  587.                 return SplitBrowser.activeBrowser.aioNativeRemoveTab = val;
  588.             },
  589.             get moveTabTo()
  590.             {
  591.                 return this.wrappedNativeMoveTabTo;
  592.             },
  593.             wrappedNativeMoveTabTo : function() {
  594.                 SplitBrowser.activeBrowser.moveTabTo.apply(SplitBrowser.activeBrowser, arguments);
  595.             },
  596.             set moveTabTo(val)
  597.             {
  598.                 return SplitBrowser.activeBrowser.moveTabTo = val;
  599.             },
  600.             get addTab()
  601.             {
  602.                 return this.wrappedNativeAddTab;
  603.             },
  604.             wrappedNativeAddTab : function() {
  605.                 SplitBrowser.activeBrowser.addTab.apply(SplitBrowser.activeBrowser, arguments);
  606.             },
  607.             set addTab(val)
  608.             {
  609.                 return SplitBrowser.activeBrowser.addTab = val;
  610.             }
  611.         };
  612.  
  613.         window.aioRendering = {
  614.             addEventListener : function()
  615.             {
  616.                 appcontent.addEventListener.apply(appcontent, arguments);
  617.             },
  618.             removeEventListener : function()
  619.             {
  620.                 appcontent.removeEventListener.apply(appcontent, arguments);
  621.             },
  622.             get childNodes() {
  623.                 return window.aioContent.mPanelContainer.childNodes;
  624.             },
  625.             get selectedIndex() {
  626.                 return window.aioContent.mPanelContainer.selectedIndex;
  627.             },
  628.             set selectedIndex(val) {
  629.                 return window.aioContent.mPanelContainer.selectedIndex = val;
  630.             }
  631.         };
  632.     }
  633. };
  634.